package pers.cj.pdos.constant;

/**
 * 单号编号类型
 * 注意，请不要更改type
 */
public enum GoodsAttrColor {
    RED("红色", 1),
    COLOR("橙色", 2),
    YELLOW("黄色", 3),
    GREEN("绿色", 4),
    CYAN("青色", 5),
    BLUE("蓝色", 6),
    PURPLE("紫色", 7),
    GRAY("灰色", 8),
    WHITE("白色", 9),
    BLACK("黑色", 10),
    PINK("粉色", 11),
    ;
    // 成员变量
    private String name;
    private int type;

    // 构造方法
    GoodsAttrColor(String name, int type) {
        this.name = name;
        this.type = type;
    }
    // 普通方法
    public static GoodsAttrColor getObj(int type) {
        for (GoodsAttrColor goodsAttrColor : GoodsAttrColor.values()) {
            if (goodsAttrColor.getType() == type) {
                return goodsAttrColor;
            }
        }
        return null;
    }

    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public int getType() {
        return type;
    }
    public void setType(int type) {
        this.type = type;
    }

}
